-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate polling attributes in electrical measurement cluster #354
base: dev
Are you sure you want to change the base?
Conversation
As suggested in zigpy#339 (comment) this adds an `ZCL_POLLING_ATTRS` to define attributes that should be polled separatelly from the ones that can have reporting config. This also moves some attributes that do no support reporting config out of `REPORT_CONFIG`.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #354 +/- ##
==========================================
- Coverage 96.51% 96.50% -0.01%
==========================================
Files 61 61
Lines 9457 9455 -2
==========================================
- Hits 9127 9125 -2
Misses 330 330 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change ZCL_POLLING_ATTRS
to just be a list of the attribute names, similar to ZCL_INIT_ATTRS
. (async_update
needs to be adjusted too then.)
Yeah, that was a stupid Sunday night copy/paste I did there 🙃 |
) | ||
ZCL_POLLING_ATTRS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we might want ZCL_POLLING_ATTRS
to be a list
instead of a set
, so that the attributes are always polled in the same (expected) order. So, just ZCL_POLLING_ATTRS = [...]
.
Since we don't poll the divider/multiplier here at the moment, this might not matter, but I think it would be better anyways and keep the same order from before when a (sorted) dict was used.
(Since we're not searching for anything in ZCL_POLLING_ATTRS
, a list should be fine performance-wise. Might even save a bit on memory if we use a list. Though it's not like that really matters here..)
As suggested in #339 (comment) this adds
an
ZCL_POLLING_ATTRS
to define attributes that should be polledseparatelly from the ones that can have reporting config.
This also moves some attributes that do no support reporting config out
of
REPORT_CONFIG
.